-
Notifications
You must be signed in to change notification settings - Fork 6
Fix recipe validation: rate limiting and model validation errors #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add automatic retry logic for 429 (Too Many Requests) errors with exponential backoff to handle API rate limits during recipe validation. Enable retries by default with 3 attempts using rate-limit-friendly timing (1s start, 120s max, 2x backoff factor). Fix validator trigger/action validation that was broken due to data structure mismatch. Convert connector actions and triggers from list format to dict format for proper validation. Improve data pill validation to handle different pill types (output, refs, project_property) with type-specific required field validation. Add comprehensive test coverage for retry behavior and update existing tests to work with new retry configuration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Updated the OpenAPI spec to make the ConnectorAction.title field optional and nullable, reflecting the actual API behavior where some connector actions/triggers return null for this field. Also added lazy-imports dependency required by the auto-generated OpenAPI client code. Changes: - Updated ConnectorAction schema in workato-api-spec.yaml - Added lazy-imports>=0.3.1 to pyproject.toml dependencies - Regenerated OpenAPI client with updated spec 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add aiohttp-retry to pre-commit mypy additional_dependencies - Remove unused type ignore comment for aiohttp_retry import - Ensures both local pre-commit and GitHub Actions mypy use same config 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes two critical bugs preventing recipe validation from working correctly: rate limiting (429 errors) and model validation failures. The changes add automatic retry logic with exponential backoff for rate-limited requests and update the OpenAPI schema to allow null title fields in connector actions.
- Added retry configuration with 429 status code support and exponential backoff timing
- Fixed ConnectorAction schema to make title field optional/nullable
- Updated validator to handle ConnectorAction objects correctly as lists rather than dicts
- Regenerated OpenAPI client with lazy imports support
Reviewed Changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| workato-api-spec.yaml | Made title field optional and nullable in ConnectorAction schema |
| src/workato_platform/init.py | Added retry configuration function with 429 support |
| src/workato_platform/cli/commands/recipes/validator.py | Fixed connector trigger/action handling and improved data pill validation |
| tests/unit/test_retry_429.py | Added comprehensive tests for 429 retry configuration |
| tests/unit/test_workato_client.py | Updated test to include retry configuration mocking |
| tests/unit/commands/recipes/test_validator.py | Fixed test to use ConnectorAction objects instead of dicts |
| src/workato_platform/client/workato_api/models/connector_action.py | Regenerated model with optional title field |
| src/workato_platform/client/workato_api/api_client.py | Added UUID serialization support and regex fix |
| pyproject.toml | Added lazy-imports dependency |
| .pre-commit-config.yaml | Added aiohttp-retry dependency |
| Various generated files | Regenerated OpenAPI client with new generator version |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
oalami
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- what functionality is
lazy-importsproviding? - why the use of
UUIDinstead of keeping it asStrictStr?
I am getting this warning when running the CLI:
(workato-platform-cli) ossama@oalami-MacBook workato-platform-cli % workato
/Users/ossama/dev/workato-platform-cli/.venv/lib/python3.11/site-packages/lazy_imports/lazy_module.py:142: ShadowingWarning: ApiClient (attribute 'ApiClient' imported from module workato_platform.client.workato_api.models.api_client) shadows attribute 'ApiClient' imported from module workato_platform.client.workato_api.api_client in lazy module workato_platform.client.workato_api
warnings.warn(
Usage: workato [OPTIONS] COMMAND [ARGS]...
CLI tool for the Workato API
Options:
--profile TEXT Profile to use for authentication and region settings
--version Show the version and exit.
--help Show this message and exit.
Commands:
api-clients Manage API clients
api-collections Manage API collections (generates recipes and...
assets List project assets (data tables, custom connectors,...
.....
Changed 'customer_connectores_response' to 'custom_connectors_response' in recipe validator to correctly reflect the variable's purpose and improve code readability. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Upgraded openapi-generator-cli to 7.16.0 and disabled lazy imports to: 1. Eliminate the lazy-imports dependency (supply-chain security concern) 2. Resolve ShadowingWarning about ApiClient naming conflict The lazy-imports package was causing a ShadowingWarning due to ApiClient being imported from both workato_api.models.api_client and workato_api.api_client. By removing lazy-imports entirely, both issues are resolved. Changes: - Upgraded openapi-generator-cli from 7.15.0 to 7.16.0 - Added lazyImports: false to openapi-config.yaml - Removed lazy-imports>=0.3.1 from project dependencies - Regenerated OpenAPI client with lazy imports disabled - Generated code now uses direct imports instead of lazy loading The trade-off of slightly slower import times is acceptable for our API size in exchange for reduced dependencies and security surface area. All tests, linting, and type checking pass. Resolves DEVP-287: Document lazy-imports dependency purpose and usage Resolves DEVP-289: Fix ShadowingWarning from lazy-imports when running CLI 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Lazy-imports was added by OpenAPI Generator 7.15.0 to potentially improve import performance. However, the OpenAPI community raised concerns about they added a feature flag in v7.16.0+ to make lazy imports optional. That's why I just upgraded to 7.16.0+ and disabled lazy imports by setting lazyImports: false in openapi-config.yaml.
This is auto-generated code due to upgrading to 7.15.0 for cases like this:
Fixed by upgrading to v7.16.0+ and disabling lazy imports. |

Summary
This PR fixes two critical bugs that were preventing recipe validation from working properly:
Changes Implemented
Rate Limiting Fix (DEVP-12)
Commit: 697322c
Model Validation Fix (DEVP-270)
titlefield optional in theConnectorActionschema, matching the actual API behaviorlazy-imports>=0.3.1dependency (required by generated client)Commit: 5cdb309
Testing
🤖 Generated with Claude Code